from pyamf.remoting.gateway.django import DjangoGateway

import smithwaterman.interf

request = 0

def echo(data):
    global request
    request += 1
    return str(request)

services = {
    'demo.echo' : echo,
    'demo.addSimilarityMatrix' : smithwaterman.interf.addSimilarityMatrix,
    'demo.delSimilarityMatrix' : smithwaterman.interf.delSimilarityMatrix,
    'demo.readSimilarityMatrixNumber' : smithwaterman.interf.readSimilarityMatrixNumber,
    'demo.checkSimilarityMatrix' : smithwaterman.interf.checkSimilarityMatrix,
    'demo.readSimilarityMatrixIDs' : smithwaterman.interf.readSimilarityMatrixIDs,
    'demo.readSimilarityMatrixDetails' : smithwaterman.interf.readSimilarityMatrixDetails,
    'demo.addMatrixElement' : smithwaterman.interf.addMatrixElement,
    'demo.modMatrixElement' : smithwaterman.interf.modMatrixElement,
    'demo.addSequence' : smithwaterman.interf.addSequence,
    'demo.delSequence' : smithwaterman.interf.delSequence,
    'demo.readSequences' : smithwaterman.interf.readSequences,
    'demo.readSequenceDetails' : smithwaterman.interf.readSequenceDetails,
    'demo.startCalculation' : smithwaterman.interf.startCalculation,
    'demo.getFirstResult' : smithwaterman.interf.getFirstResult,
    'demo.getSecondResult' : smithwaterman.interf.getSecondResult
}

gateway = DjangoGateway(services, expose_request=False)
